home *** CD-ROM | disk | FTP | other *** search
- class classes.misc.Reanimator
- {
- var x;
- var y;
- var xMov;
- var clip;
- var currentVol;
- var origVol;
- var xMovT = 0;
- var c = 0;
- var hc = 0;
- var summoning = false;
- var fOut = true;
- var fIn = false;
- var hit = false;
- function Reanimator(px, py)
- {
- _root.rean = true;
- this.x = px;
- this.y = py;
- this.xMov = 4;
- this.xMovT = 4;
- _root.d = _root.d + 1;
- this.clip = _root.attachMovie("reanimator","reanimatorClip",_root.d);
- this.clip._x = this.x;
- this.clip._y = this.y;
- this.currentVol = _root.aC1.s1.getVolume();
- this.origVol = this.currentVol;
- }
- function main()
- {
- _root.c = _root.c - 1;
- if(this.fOut)
- {
- _root.aC1.s1.setVolume(this.currentVol -= 0.25);
- if(this.currentVol == 10)
- {
- _root.aC1.s1.setVolume(10);
- this.fOut = false;
- }
- }
- if(this.fIn)
- {
- _root.aC1.s1.setVolume(this.currentVol += 1);
- if(this.currentVol >= this.origVol)
- {
- _root.aC1.s1.setVolume(this.origVol);
- this.fIn = false;
- }
- }
- if(this.clip.hitTest(_root[_root.char + "Clip"]))
- {
- if(_root.gems.num >= 20 && this.x > 100 && this.x < 950 && !this.hit)
- {
- this.hit = true;
- this.summoning = true;
- this.c = 0;
- _root.audio.playLevel3("gem" + (random(3) + 1),_root.randRange(20,25));
- this.clip.speech._visible = false;
- this.clip.ship.gotoAndPlay("go");
- _root.gems.addTo(-20);
- this.xMovT = 0;
- }
- else
- {
- _root.gems.alpha = 120;
- }
- }
- if(this.summoning)
- {
- this.c = this.c + 1;
- if(this.c == 65)
- {
- _root.audio.playLevel2("reanimate",20);
- if(_root.char == "broShip1" || _root.char == "bro1")
- {
- _root.bro2ShipLevel = 3;
- _root.bro2ShipVar = 7;
- _root.char2 = "broShip2";
- _root.bro2Life = 100;
- _root.broShip2 = new classes.bro.BroShip2(this.x - 100,this.y - 10);
- _root.addChar("broShip2");
- _root.broShip2.control = false;
- _root.broShip2.reanimate();
- _root.broShip2Clip.gun.gotoAndPlay("appear");
- }
- else
- {
- _root.bro1ShipLevel = 3;
- _root.bro1ShipVar = 7;
- _root.char2 = "broShip1";
- _root.bro1Life = 100;
- _root.broShip1 = new classes.bro.BroShip1(this.x - 100,this.y - 10);
- _root.addChar("broShip1");
- _root.broShip1.control = false;
- _root.broShip1.reanimate();
- _root.broShip1Clip.gun.gotoAndPlay("appear");
- }
- }
- if(this.c == 160)
- {
- if(_root.char == "broShip1" || _root.char == "broShip2")
- {
- _root[_root.char2].action11();
- }
- else
- {
- var _loc4_ = _root.char;
- _root.char = _root.char2;
- _root.char2 = _loc4_;
- _root[_root.char].giveControl();
- _root[_root.char].weapon = _root[_root.char2].weapon;
- _root.bro1Weapon = _root.bro2Weapon = _root[_root.char].weapon;
- var _loc3_ = _root[_root.char].weapon;
- _root[_root.char][_loc3_]();
- _root[_root.char].life = 100;
- _root[_root.char2].action11();
- }
- this.xMovT = 7;
- this.fIn = true;
- }
- }
- if(this.x > 800 && this.x < 805)
- {
- this.fIn = true;
- }
- if(this.x > 1020 && !this.fIn)
- {
- _root.removeFX("reanimator");
- }
- if(this.xMovT < this.xMov)
- {
- this.xMov -= 0.25;
- }
- else if(this.xMovT > this.xMov)
- {
- this.xMov += 0.25;
- }
- else
- {
- this.xMov = this.xMovT;
- }
- this.x += this.xMov;
- this.clip.ship._y += 0.25 * Math.sin(this.hc += 0.1);
- this.clip._x = this.x;
- }
- }
-